<%-- 
    Document   : accueil
    Created on : 16 mars 2012, 09:48:55
    Author     : dewinter
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <link rel="stylesheet" type="text/css" href="../css/style.css" />
        <title>Accueil</title>
    </head>
    <body>
    <div id="container">
        <div id="header">
            <%@include file="template/header.jsp" %>
        </div>
        <div id="center-layout">
            <div id="content">
                <h1>Bonjour <c:out value="${currentEmp.prenom} ${currentEmp.nom}"/></h1>
                <h2>Vos tables :</h2>
                <table>
                    <tr>
                        <th>Nom</th>
                        <th>Nombre de personnes</th>
                    </tr>
                    <c:forEach items="${currentEmp.tables}" var="table">
                        <tr>
                            <td><c:out value="${table.nom}"/></td>
                            <td style="text-align: center;"><c:out value="${table.nombre_personnes}"/></td>
                        </tr>
                    </c:forEach>
                </table>
                <h2>Vos commandes (<c:out value="${nbCommandesEnCours}"/>)</h2>
                <table>
                    <tr>
                        <th>ID</th>
                        <th>Libelle</th>
                        <th>Table</th>
                    </tr>
                    <c:forEach items="${currentEmp.commandesEnCours}" var="commande">
                        <tr>
                            <td>
                                <a href="DetailsCommande?id_commande=${commande.id_commande}"><c:out value="${commande.id_commande}"/></a>
                            </td>
                            <td>
                                <a href="DetailsCommande?id_commande=${commande.id_commande}"><c:out value="${commande.libelle}"/></a>
                            </td>
                            <td>
                                <a href="DetailsCommande?id_commande=${commande.id_commande}"><c:out value="${commande.tableResto.nom}"/></a>
                            </td>
                        </tr>
                    </c:forEach>
                </table>
                <h2>Les autres commandes</h2>
                <table>
                    <tr>
                        <th>ID</th>
                        <th>Libelle</th>
                        <th>Table</th>
                        <th>&nbsp;</th>
                    </tr>
                    <c:forEach items="${commandes}" var="commande">
                        <c:if test="${commande.serveur eq null}">
                            <tr>
                                <td>
                                    <a href="DetailsCommande?id_commande=${commande.id_commande}"><c:out value="${commande.id_commande}"/></a>
                                </td>
                                <td>
                                    <a href="DetailsCommande?id_commande=${commande.id_commande}"><c:out value="${commande.libelle}"/></a>
                                </td>
                                <td>
                                    <a href="DetailsCommande?id_commande=${commande.id_commande}"><c:out value="${commande.tableResto.nom}"/></a>
                                </td>
                                <td>
                                    <form action="DetailsCommande" method="POST">
                                        <input type="hidden" name="ID_Commande" value="${commande.id_commande}"/>
                                        <input type="submit" name="takeCommande" value="Prendre"/>
                                    </form>
                                </td>
                            </tr>
                        </c:if>
                    </c:forEach>
                </table>
            </div>
        </div>
            <div id="right-layout">
                
            </div>
            <div id="left-layout">
                <%@include file="template/left-layout.jsp" %>
            </div>
    </div>
    </body>
</html>
